<%
  String str_targetURL = application.getInitParameter("TARGET_URL");
  String str_signatureType = application.getInitParameter("SIGNATURE_TYPE");
  String str_signatureMechanism = application.getInitParameter("SIGNATURE_MECHANISM");
  String str_contentSource = application.getInitParameter("CONTENT_SOURCE");
  String str_resultPage = application.getInitParameter("RESULT_PAGE");
  String str_errorPage = application.getInitParameter("ERROR_PAGE");
  String str_rootFolderUrl = application.getInitParameter("ROOT_FOLDER_URL"); 
  String str_outputPDF = (String) session.getAttribute("str_documentId");  
  str_outputPDF="test";  
  String str_pdfPath = "pdfs/" + str_outputPDF + ".pdf";  
  int i_indexPos = str_resultPage.lastIndexOf("/");
  String str_filesDownloadingBasePath = str_resultPage.substring(0, i_indexPos + 1);
%>
<html> 
  <head> 
    <title>PDF Zero Footprint Signing Demo</title> 
    <script language="JavaScript" src="GoSign/lib/gosign.js"></script> 
  </head> 
  <body leftmargin="0" topmargin="0"> 
    <center> 
<form name="mainForm">
  <input type="hidden" name="hdn_targetPDF" value="<%=str_outputPDF%>"/>
  <table width="825" border="0" cellpadding="0" cellspacing="0">
    <!--DWLayoutTable-->
    <tr>
      <td width="13" height="10"></td>
      <td width="973"></td>
      <td width="13"></td>
    </tr>
    <tr>
      <td height="654"></td>
      <td valign="top">
        <table width="831" height="649" border="0" cellpadding="3" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="825" height="649" colspan="2" align="center" valign="top">
            <table width="800" border="0" cellpadding="0" cellspacing="0">
                <!--DWLayoutTable-->
                <tr>
                  <td width="225" height="592">
                  <td width="958" height="592">
            <iframe height="600" width="800" id="pdf-frame" src="<%=str_pdfPath%>">This page requires a browser that will support in-line frames.</iframe>
                  </td>
                </tr>
                <tr>
                  <td height="47">
                  <td height="47">
 
                  </td>
                </tr>
              </table>
            </td>
          </tr>
        </table>
      </td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td height="2">
        <img src="images.gif" alt="" width="40" height="1">
      </td>
      <td colspan="2">
        <img src="images.gif" alt="" width="565" height="1">
      </td>
    </tr>
  </table>
</form>
     
<script type="text/javascript">
GoSign_EmbedApplet('<%=str_rootFolderUrl%>', '<%=str_signatureType%>', '<%=str_signatureMechanism%>', '<%=str_contentSource%>');
</script> 
</center> 


</body> 
</html> 
<script language="JavaScript" > 
function init() { 
  var b_available = GoSign_IsAvailable(); 
  if( b_available == true ){ 
    
GoSign_SetAliasDisplayTemplate(GoSign_Constants.SUBJECT_CN+","+GoSign_Constan
ts.ISSUER_O); 
    GoSign_SetAliasDisplayValueMissing("N/A"); 
    //Form name can be set by un-commenting the below statement. 
    //GoSign_SetFormName('mainForm'); 
    if( GoSign_SetFilterCriteria(GoSign_Constants.SHOW_EXPIRED_CERTIFICATES, 
GoSign_Constants.FALSE) != true){ 
      alert(GoSign_GetErrorReason()); 
      return; 
    } 
    if( GoSign_ShowCertificates() != true){ 
      alert(GoSign_GetErrorReason()); 
      return; 
    } 
    GoSign_SetResultPage('<%=str_resultPage%>');
    GoSign_SetTargetURL('<%=str_targetURL%>');
  } 
  else{ 
    alert(GoSign_GetErrorReason()); 
  } 
} 
function CheckSignDocReq(){ 
  if(GoSign_SignDocument() != true){ 
    alert(GoSign_GetErrorReason()); 
    if(GoSign_GetErrorCode() == 1011){ 
      return; 
    } 
  } } 
window.onload = init; 
</script> 